package com.example.emergency;








import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Color;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class Empty extends Activity{
	private TempDB mDbtemp;
	//private EditText mTitleText;
    private TextView mBodyText;
    private Long mRowId;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		
		mDbtemp = new TempDB(this);
    	mDbtemp.open();
    	final MediaPlayer mp=MediaPlayer.create(this, R.raw.sound4);
    	setContentView(R.layout.empty);
    	Button b=(Button)findViewById(R.id.back);
    	b.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent i=new Intent(Empty.this,EmergencyfirstAid.class);
				startActivity(i);	
				mp.start();
			}
		});

    	mBodyText = (TextView) findViewById(R.id.pppp);
    	mBodyText.setTextColor(Color.RED);

    	mRowId = (savedInstanceState == null) ? null : (Long) savedInstanceState.getSerializable(TempDB.KEY_ID);
    	if (mRowId == null) {
    	    Bundle extras = getIntent().getExtras();
    	    mRowId = extras != null ? extras.getLong(TempDB.KEY_ID)
    	                            : null;
    	}
    	populateFields();    	
    }
	 private void populateFields() {
		    if (mRowId != null) {
		        Cursor note = mDbtemp.fetchNote(mRowId);
		        startManagingCursor(note);
		        mBodyText.setText(note.getString(
		                note.getColumnIndexOrThrow(TempDB.KEY_PHNO)));
		    	
		    }
		}
	}

